//重构组织架构的数据结构
export function resetCompanyDepartmentData(listData, rootPid) {
  const result = []
  listData.forEach(item => {
    if (item.pid === rootPid) {
      // 如果相等则继续找children
      const children = resetCompanyDepartmentData(listData,item.id)
      if(children.length){
        item.children = children
      }
     result.push(item)
    }
  })
  return result
}
